import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  // 1. 重定向
  {
    path: '/',
    redirect: '/home'
  },
  // 首页
  {
    path: '/home',
    component: () => import('../views/home')
  },

  //  2. 404,放在最后
  {
    path: '*',
    component: () => import('../views/PageNoFound')
  }
]

const router = new VueRouter({
  routes
})

export default router
